package com.zhihuishu.micro.course.openapi.course;

import com.zhihuishu.micro.course.openapi.course.dto.CourseLessonDto;
import com.zhihuishu.remote.RemoteException;
import com.zhihuishu.remote.RemoteResult;

import java.util.List;

/**
 * @author Jiangli
 * @date 2016/10/17 13:57
 */
public interface CourseLessonOpenService {
    /**
     * 增加一个新的节
     * * courseId not null
     * * chapterId not null
     *  rank not null
     *
     * @param lessonDto
     * @param createUserId
     * @return
     * @throws RemoteException
     */
    RemoteResult<CourseLessonDto> createByDto(CourseLessonDto lessonDto, long createUserId) throws RemoteException;

    /**
     * 更新某节数据
     * @param lesson
     * @param updateUserId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> updateByDto(CourseLessonDto lesson ,long updateUserId) throws RemoteException ;

    /**
     * 删除某节
     * @param lessonId
     * @param deleteUserId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> deleteById(Integer lessonId , long deleteUserId) throws RemoteException;

    /**
     * 查询课程下的节列表
     * @param courseId
     * @return
     * @throws RemoteException
     */
    RemoteResult<List<CourseLessonDto>> queryListByCourseId(long courseId) throws RemoteException ;

    /**
     * 更新节顺序
     * @param lessonList
     * @param updateUserId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> sortByDtoList(List<CourseLessonDto> lessonList ,long updateUserId) throws RemoteException ;

}
